- wiki_path = wiki_page_path(@wiki, wiki_directory)

%li{ data: { testid: 'wiki-directory-content' } }
  .gl-relative.gl-flex.gl-items-center.js-wiki-list-toggle.wiki-list.gl-rounded-base.gl-cursor-pointer{ data: { testid: 'wiki-list' }, class: active_when(params[:id] == wiki_directory.slug) }
    = link_to wiki_path, data: { testid: 'wiki-dir-page-link', qa_page_name: wiki_directory.title }, class: 'gl-str-truncated ' do
      = wiki_directory.title
    - plus_tooltip_title = safe_format(s_('Wiki|Create a new page under "%{page_title}"'), { page_title: wiki_directory.title })
    - if can?(current_user, :create_wiki, @wiki)
      = render Pajamas::ButtonComponent.new(icon: 'plus', size: :small, category: :tertiary, href: "#{wiki_path}/{new_page_title}", button_options: { class: 'wiki-list-create-child-button gl-ml-2 has-tooltip', title: plus_tooltip_title, aria: { label: plus_tooltip_title } })
    = sprite_icon('chevron-right', css_class: 'js-wiki-list-expand-button wiki-list-expand-button gl-ml-2')
    = sprite_icon('chevron-down', css_class: 'js-wiki-list-collapse-button wiki-list-collapse-button gl-ml-2')
  %ul{ class: '!gl-pl-5' }
    - wiki_directory.entries.each do |entry|
      = render partial: entry.to_partial_path, object: entry, locals: { context: context }
